document.domain="baidu.com";
union.main.client.initAccount.Init={initialize:function(a){var b=0;
baidu.dom.setAttr(baidu.G("DateShortcutType").options[b],"selected","selected");
this.getReportJson(b);
this.getSysMsgJson();
baidu.G("DateShortcutType").onchange=union.main.client.initAccount.Init.initSumReport
},initRankStar:function(){var k=baidu.dom.getAttr("RankStar","title");
var f=k.match(/\d+/);
var d=parseInt(f);
var l=parseInt(d/10);
var b=parseInt((d%10)/2);
var h=baidu.G("RankStar").getElementsByTagName("a")[0];
if(d<50){for(var g=0;
g<l;
g++){var c=document.createElement("img");
c.className="star";
c.setAttribute("src","/un-web-lib/css/img/none.gif");
h.appendChild(c)
}for(var e=0;
e<b;
e++){var a=document.createElement("img");
a.className="star_bw";
a.setAttribute("src","/un-web-lib/css/img/none.gif");
h.appendChild(a)
}}else{for(var g=0;
g<5;
g++){var c=document.createElement("img");
c.className="star";
c.setAttribute("src","/un-web-lib/css/img/none.gif");
h.appendChild(c)
}}},getReportJson:function(a){union.lib.Ajax.loadJSON({url:"/client/indexReport/accountReport!reportJson.action",data:"dateType="+a,onSuccess:function(b){baidu.G("Report").innerHTML=renderReport({data:b,bizStatus:union.main.client.initAccount.bizStatus,customer:union.main.client.initAccount.customer});
if(baidu.G("Divide")){baidu.G("Divide").innerHTML=b.divide||"--&nbsp;"
}union.main.client.initAccount.Init.renderTable();
union.main.client.initAccount.Init.viewReportDetail()
}})
},renderTable:function(){var f=baidu.G("ReportTable");
var b=baidu.G("ReportSPTable");
var c=f.getElementsByTagName("tbody")[0];
if(baidu.dom.children(c).length>0){var g=c.getElementsByTagName("tr");
for(var d=0;
d<g.length;
d++){g[d].onmouseover=function(){baidu.addClass(this,"hover")
};
g[d].onmouseout=function(){baidu.removeClass(this,"hover")
}
}}var a=b.getElementsByTagName("tbody")[0];
if(baidu.dom.children(a).length>0){var e=a.getElementsByTagName("tr");
e[0].onmouseover=function(){baidu.addClass(this,"hover")
};
e[0].onmouseout=function(){baidu.removeClass(this,"hover")
}
}},initSumReport:function(){var a=this.value;
setTimeout(function(){union.main.client.initAccount.Init.getReportJson(a)
},0)
},viewReportDetail:function(){if(baidu.G("ReportTable").getElementsByTagName("tr").length>0||baidu.G("ReportSPTable").getElementsByTagName("tr").length>0){var a=baidu.dom.query("#Report table a");
var c,d;
for(var b=0;
b<a.length;
b++){a[b].onclick=function(){d=baidu.G("DateShortcutType").value;
location.href=this.getAttribute("href")+"~dateShortcutType="+d;
return false
}
}}},getSysMsgJson:function(){var a=this;
union.lib.Ajax.loadJSON({url:"/client/msg/bulletin!showMsgAjax.action",onSuccess:function(b){baidu.G("SysMsgWrapper").innerHTML=renderSysMsg({data:b});
setTimeout(function(){a.recalculateHeight()
},500)
},noLoading:true})
},recalculateHeight:function(){var a=baidu.G("Right").scrollHeight;
if(baidu.G("Left").scrollHeight<a){baidu.G("Left").style.minHeight=a+"px";
if(baidu.browser.ie){baidu.G("Left").style.height=a+"px"
}}},getIframeStatus:function(){baidu.removeClass("Strategy","hidden");
var b=baidu.G("Strategy");
try{if(baidu.browser.isWebkit){b.height=b.contentWindow.document.documentElement.offsetHeight
}else{b.height=b.contentWindow.document.body.scrollHeight
}}catch(a){}},ready:1};
elf.dom.Event.add(window,"load",function(){union.main.client.initAccount.Init.initialize()
});